import Vue from 'vue'
import {getShow,getShowAns} from "@/api/showindex";
import {VCard,VImg} from 'vuetify/lib'


interface IData {
    showImg: Array<any>,
    isActive: boolean
}
export default Vue.extend({
    name: 'LiveShow',
    data:(): IData => ({
        showImg: [],
        isActive: false
    }),
    components: {
        'v-card': VCard,
        'v-img': VImg,
    },
    mounted() {
        getShow()
            .then(res => {
                const {code,msg,data} = res as unknown as getShowAns
                if(code === 200){
                    this.showImg = data
                }else{
                    console.log(msg)
                }
            })
    },
    render(){
        return (
            <div>
                <div style={{marginTop: '2vh'}}>
                    <div style={{fontSize: '6vw',fontWeight: 'bold',margin: '2vh 0'}}>现场快照</div>
                    {
                        this.showImg?.map(item => {
                            return (
                                <v-card key={item.showId} style={{marginBottom: '1.5vh'}}>
                                    <v-img src={item.showImg} options={{threshold: 1.0}}></v-img>
                                </v-card>
                            )
                        })
                    }
                </div>
            </div>
        )
    }
})